import os


def calc_folder_size(name):
    target = os.path.join(os.getcwd(), name)
    folder_size = 0
    for root, dirs, files in os.walk(target):
        for file in files:
            folder_size += os.path.getsize(os.path.join(root, file))
    return folder_size


folder_name = 'folder_measure'
print('%s文件夹大小为%d字节' % (folder_name, calc_folder_size(folder_name)))
